#include "StdAfx.h"
#include "CircuitComponent.h"


CCircuitComponent::CCircuitComponent(void)
{

	m_szLibraryDescription = _T("");

}

CCircuitComponent::CCircuitComponent(const CCircuitComponent *pEntityObj)
{
	m_szLibraryDescription = pEntityObj->GetLibraryDescription();

}



CCircuitComponent::~CCircuitComponent(void)
{
	list<CCircuitUnit *>::iterator it_unit;
	for (it_unit=m_lstNormalUnit.begin(); it_unit!=m_lstNormalUnit.end(); it_unit++)
		delete (*it_unit);
	m_lstNormalUnit.clear();

	for (it_unit=m_lstDeMorganUnit.begin(); it_unit!=m_lstDeMorganUnit.end(); it_unit++)
		delete (*it_unit);
	m_lstDeMorganUnit.clear();

	for (it_unit=m_lstIEEEUnit.begin(); it_unit!=m_lstIEEEUnit.end(); it_unit++)
		delete (*it_unit);
	m_lstIEEEUnit.clear();
}

void CCircuitComponent::Serialize(CArchive & ar)
{

}

CCircuitComponent *CCircuitComponent::Clone() const
{
	return new CCircuitComponent(this);
}


list< CCircuitUnit  *> CCircuitComponent::GetNormalUnitList() const
{
	return m_lstNormalUnit;
}

list< CCircuitUnit  *> CCircuitComponent::GetDeMorganUnitList() const
{
	return m_lstDeMorganUnit;
}

list< CCircuitUnit  *> CCircuitComponent::GetIEEEUnitList() const
{
	return m_lstIEEEUnit;
}

list<CString> CCircuitComponent::GetLibraryFiledList() const
{
	return m_libraryFieldList;
}

list<CString> CCircuitComponent::GetLibraryRefList() const
{
	return m_libraryRefList;
}

CString CCircuitComponent::GetLibraryDescription() const
{
	return m_szLibraryDescription;
}

CString CCircuitComponent::GetFootprint() const
{
	return m_szFootprint;
}


void CCircuitComponent::SetNormalUnitList(list< CCircuitUnit  *> lstUnits)
{
	m_lstNormalUnit = lstUnits;
}

void CCircuitComponent::SetDeMorganUnitList(list< CCircuitUnit  *> lstUnits)
{
	m_lstDeMorganUnit = lstUnits;
}

void CCircuitComponent::SetIEEEUnitList(list< CCircuitUnit  *> lstUnits)
{
	m_lstIEEEUnit = lstUnits;
}

void CCircuitComponent::AddNormalUnit( CCircuitUnit  *pUnit)
{
	m_lstNormalUnit.push_back(pUnit);
}

void CCircuitComponent::AddDeMorganUnit( CCircuitUnit  *pUnit)
{
	m_lstDeMorganUnit.push_back(pUnit);
}

void CCircuitComponent::AddIEEEUnit( CCircuitUnit  *pUnit)
{
	m_lstIEEEUnit.push_back(pUnit);
}




void CCircuitComponent::SetLibraryFiledList(list<CString> lstField)
{
	m_libraryFieldList = lstField;
}

void CCircuitComponent::AddLibraryField(CString szField)
{
	m_libraryFieldList.push_back(szField);
}

void CCircuitComponent::SetLibraryRefList( list<CString> lstLibRef)
{
	m_libraryRefList = lstLibRef;
}

void CCircuitComponent::AddLibraryRef( CString szLibRef)
{
	m_libraryRefList.push_back(szLibRef);
}

void CCircuitComponent::SetLibraryDescription( CString szLibDes)
{
	m_szLibraryDescription = szLibDes;
}

void CCircuitComponent::SetFootprint( CString szFootprint)
{
	m_szFootprint = szFootprint;
}





